import request from '@/config/axios'

export interface ClassesVO {
  id: number
  classesName: string
  classesCode: string
  schoolId: number
  collegeId: number
  majorId: number
}

// 查询班级分页
export const getClassesPage = async (params) => {
  return await request.get({ url: `/cmis/classes/page`, params })
}

// 查询班级列表
export const getClassesList = async (params) => {
  return await request.get({ url: `/cmis/classes/list`, params })
}

// 查询班级列表
export const queryClassesList = async (params) => {
  return await request.get({ url: `/cmis/classes/query`, params })
}

// 查询班级详情
export const getClasses = async (id: number) => {
  return await request.get({ url: `/cmis/classes/get?id=` + id })
}

// 新增班级
export const createClasses = async (data: ClassesVO) => {
  return await request.post({ url: `/cmis/classes/create`, data })
}

// 修改班级
export const updateClasses = async (data: ClassesVO) => {
  return await request.put({ url: `/cmis/classes/update`, data })
}

// 删除班级
export const deleteClasses = async (id: number) => {
  return await request.delete({ url: `/cmis/classes/delete?id=` + id })
}

// 导出班级 Excel
export const exportClasses = async (params) => {
  return await request.download({ url: `/cmis/classes/export-excel`, params })
}

// 批量删除班级
export const batchDeleteClasses = async (ids: Array<string>) => {
  return await request.delete({ url: `/cmis/classes/batchDelete?ids=` + ids })
}

// 导入批量导入班级
export const importClasses = async (data) => {
  return await request.post({ url: `/cmis/classes/import`, data })
}
